<template>
  <el-table :data="tableData" border style="width: 100%">
    <el-table-column prop="id" label="ID"  />
    <el-table-column prop="login_name" label="用户名"  />
    <el-table-column prop="no" label="工号" />
    <el-table-column prop="name" label="姓名"  />
    <el-table-column prop="email" label="邮箱"  />
    <el-table-column prop="phone" label="手机号" />
    <el-table-column prop="user_type" label="用户类型" >
    <template v-slot="scope">
    {{ scope.row.user_type==0?"员工":scope.row.user_type==1?"组长":scope.row.user_type==2?"主管":scope.row.user_type==3?"经理":"董事长" }}
    </template>
    </el-table-column>
    <el-table-column prop="sex" label="性别"  >
    <template v-slot="scope">
    {{ scope.row.sex==1?"男":"女" }}
    </template>
    </el-table-column>
    <el-table-column prop="mgr_type" label="管理员类别" />
    <el-table-column prop="avatar" label="照片"  />
    <el-table-column prop="login_ip" label="登录IP"  />
    <el-table-column prop="login_flag" label="是否启用"  />
    <el-table-column prop="create_by" label="创建人" >
    <template v-slot="scope">
    {{ scope.row.create_by==6?"贺艳嵩":"管理员" }}
    </template>
    </el-table-column>
    <el-table-column prop="create_date" label="创建时间" />
    <el-table-column prop="update_by" label="修改人" />
    <el-table-column prop="update_date" label="修改时间" />
  </el-table>
</template>

<script lang="ts" setup>
import axios from 'axios';
import {ref,onMounted} from 'vue'
const tableData = ref([])
onMounted(() => {
   GetShow();  
})
const infor=ref({
    pageSize:10,
    pageIndex:1,
    phone:"",
    login_flag:-1,
    name:"",
    no:"",
    totalPage:0,
    totalCount:0
})
const GetShow=()=>{
    axios({
        method:"get",
        url:"http://1.117.93.87:8000/rbacdu/api/User/userShow",
        params:{
            pageSize:infor.value.pageSize,
            papageIndexeSize:infor.value.pageIndex,
            phone:infor.value.phone,
            login_flag:infor.value.login_flag,
            name:infor.value.name,
            no:infor.value.no
        }
    })
    .then(res=>{
        tableData.value=res.data.data.list
        infor.value.totalPage=res.data.data.totalPage
        infor.value.totalCount=res.data.data.totalCount
    })
}
</script>
